#!/bin/bash

read -p "用户名：" name

id $name &> /dev/null

if [ $? -eq 0 ]; then
  uid=$(cat /etc/passwd | grep ^$name | awk -F: '{print $3}')
  gid=$(cat /etc/passwd | grep ^$name | awk -F: '{print $4}')
  if [ $uid -eq $gid ]; then
      echo "good !!!!"
   else
       echo "bad !!!!"
   fi
else
   echo "用户不存在！！！1"
fi
